package com.example.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.example.demo.properties.TestProperties;
import com.example.demo.service.TestService;

@RequestMapping("/test")
@RestController
public class TestController {
	
	@Autowired
	private TestProperties testProperties;
	
	@Autowired
	private TestService testService;
	
	@RequestMapping("/hello")
	public String hello() {
		testService.hello(testProperties.getId(), testProperties.getVersion());
		return "hello";
	}
	
	@Value("${project}")
	private String project;
	
	@RequestMapping("/config")
	public String config() {
		return project;
	}
	
}
